package parts_of_sentence;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

public class Word {
	public static final Logger LOG = Logger.getLogger(Word.class);
	private String word;
	private List<Character> simbols = new ArrayList<Character>();

	public Word(String word) {
		this.word = word;
		fillListLetters();
	}

	private void fillListLetters() {
		word.trim();
		for (int i = 0; i < word.length() ; i++) {
			simbols.add(word.charAt(i));
			LOG.info("added simbol");
		}
	}
	
	public String collectWord() {
		String collectedWord = "";
		for (Character c : simbols) {
			collectedWord = collectedWord + c;
		}
	
		return collectedWord;
	}
	
	public String getWord() {
		return word.trim();
	}
	
	@Override
	public String toString() {
		String s = "";
		for (Character c : simbols) {
			s = s + c.toString() + "  ";
		}

		return s;
	}

	public List<Character> getLetters() {
		return simbols;
	}

}
